<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="/billing" prefix="b"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>计费后台管理</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/managercss.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/wbox.css">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/wbox.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/validate.js"></script>
<script type="text/javascript">
<!--
	$(function(){
		$(".list div").mousemove(function(){
			$(this).css("background","#E3EEFF");
		}).mouseout(function(){
			$(this).css("background","");
		});

		$("#addAdminUser").click(function(){
			var wBox = $("#ajax").wBox({
				requestType: "iframe",
				iframeWH:{width:900,height:500},
				target:"<%=request.getContextPath() %>/manage/adminUserAdd.jsp",
				title: "添加新的CP"
			});
			wBox.showBox();
		});
	});

function show(userId){
	var wBox = $("#ajax").wBox({
		requestType: "iframe",
		iframeWH:{width:900,height:500},
		target:"<%=request.getContextPath() %>/admin/adminUser/view/"+userId,
		title: "查看厂商详细信息"
	});
	wBox.showBox();
}

	function updateStatus(userId,status){
		var str;
		if(status==0){
			str = "你确定解锁该用户吗?";
		}else{
			str = "你确定锁定该用户吗?";
		}
		if(confirm(str)){
			$.ajax({
				url:"<%=request.getContextPath() %>/admin/adminUser/updateStatus?userId="+userId+"&status="+status,
				type:"GET",
				success:function(flag){
					if(flag==0){
						alert("修改成功!");
						window.location.href="<%=request.getContextPath() %>/admin/adminUser${pageBean.url }&currentPage=${pageBean.currentPage}";
					}else{
						alert("修改失败!");
					}
				}
			});
		}
	}
			
//-->
</script>
</head>
<body>
<div class="information">
	<div class="title">
		用户列表
	</div>
	<div class="listTitle">
		<ul>
			<li style="width:80px;">公司名称</li>
			<li style="width:100px;">用户名</li>
			<li style="width:100px;">用户密码</li>
			<li style="width:100px;">权限</li>
		</ul>
		<div class="clear"></div>
	</div>
	<div class="list">
		<c:forEach items="${pageBean.result}" var="user" varStatus="status">
			<div class="noselect">
				<ul>
					<li style="width:80px;">${user.cpname}</li>
					<li style="width:100px;">${user.username }</li>	
					<li style="width:100px;">${user.pwd }</li>	
					<li style="width:100px;">${user.power == 1?'管理员':'CP合作商' }</li>
				</ul>
				<div class="clear"></div>
			</div>
		</c:forEach>
	</div>
	<jsp:include page="../page.jsp" flush="true"></jsp:include>
	<div class="search">
		<input id="addAdminUser" type="button" name="addUser" value="添加新用户"/>
	</div>
</div>
</body>
</html>